/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pneuservis.backend.dao;

import java.util.List;
import javax.ejb.Local;
import pneuservis.backend.entities.ServicePneu;

/**
 * Interface ServicePneuDAO provides CRUD operations with entity ServicePneu.
 *
 * @author Juraj Palenik
 */
@Local
public interface ServicePneuDAOLocal {

    /**
     * Method createService stores a new instace of service into db.
     * 
     * @param service to be stored
     * @throws IllegalArgumentException when id is not null
     */
    void createService(ServicePneu servicePneu) throws IllegalArgumentException;

    /**
     * Method getService returns object with given Id from db.
     * If none is found null is returned
     * 
     * @param id primary key of entity
     * @return service from db, null if doesn't exist
     * @throws IllegalArgumentException if id is null
     */
    List<ServicePneu> findServiceWithName(String name) throws IllegalArgumentException;

    /**
     * Method updateService modifies existing objet in db.
     * 
     * @param servicePneu
     * @throws IllegalArgumentException if param is null, params id is null or 
     *              object with given id does not exist in db.
     */
    List<ServicePneu> getAllServices();

    /**
     * Method removeService will remove existing object from db.
     * 
     * @param servicePneu objet to be deleted from db
     * @throws IllegalArgumentException if param is null, params id is null or 
     *              object with given id does not exist in db.
     */
    ServicePneu getService(Long id) throws IllegalArgumentException;

    /**
     * Method getAllServices returns list of all services in db.
     * If table is empty, new empty list is returned.
     * 
     * @return list of all services 
     */
    void removeService(ServicePneu servicePneu) throws IllegalArgumentException;

    /**
     * Method findServiceWithName finds all services that have the given name.
     * 
     * @param name to be searched in db, not null
     * @return list of matched services
     * @throws IllegalArgumentException if name is null
     */
    void updateService(ServicePneu servicePneu) throws IllegalArgumentException;
    
}
